
$(function() {
	$('#t1').datepicker(_date1_option);

	$('#t2').datepicker(_date1_option);

	// validate signup form on keyup and submit
	var validator = $("#form_add").validate({
		rules: {
			company: {
				required: true,
				minlength:2
			},
			job: "required"
		},
		messages: {
			company: {
				required: "请输入简称",
				minlength: jQuery.format("请最少输入 {0} 个字符")
			},
			job: "请输入职位"
		},
		errorPlacement: function(label, element) {
			if (/^birthdate/.test(element[0].name)) {
				label.insertAfter("#birthdateYear");
			} else {
				label.insertAfter(element);
			}
		},
		// set this class to error-labels to indicate valid fields
		success: function(label) {
			// set &nbsp; as text for IE
			label.html("&nbsp;").addClass("checked");
		}
	});
});